Skip to content

refactor(repo): Move typedoc reflection work into custom-theme, reduce extract-methods#9073

Open
alexisintech wants to merge 14 commits into
mainfrom
aa/docs-11892
Open

refactor(repo): Move typedoc reflection work into custom-theme, reduce extract-methods#9073
alexisintech wants to merge 14 commits into
mainfrom
aa/docs-11892

Conversation

@alexisintech

@alexisintech alexisintech commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Description

Unifies the .typedoc/ pipeline so every reference-object and backend-api parent page carries all the info its extracted sub-docs need in a canonical ## H2 shape, and extract-methods.mjs becomes a pure text-slicer over those H2s — no reflection access, no marker block. Same generated docs.

Before: extract-methods.mjs was a second reflection walker layered on top of the markdown theme. It re-imported TypeDoc AST types, re-derived method/property partitioning, and re-invoked MarkdownThemeContext partials to build each per-method MDX file. Two places in the codebase had to agree on how methods vs properties are partitioned, which acronyms slug how, and which comment tags trigger inline extraction.

After: all reflection work lives in custom-theme.mjs, which now synthesizes:

## `name()`

H2 sections for every callable member that typedoc-plugin-markdown doesn't emit naturally (function-typed interface properties, extraMethodInterfaces, @extractMethods namespace callables like emailCode.sendCode). Backend-class methods get a ```typescript signature block injected after their natural description so all H2s share one shape.

## `name` 

H2 sections for @extractMethods namespaces with non-callable object-shape members (emailLink on SignInFutureResource) and each such non-callable member (emailLink.verification) — the same rows the marker-block builders used to write directly to sub-docs.

Overloaded backend-class methods: strip typedoc's per-overload ### Call Signature sub-headings and re-emit a single section for the primary signature, so the parent's shape is uniform across single- and multi-overload methods.

extract-methods.mjs slices those H2s pre-prettier, reshapes each into methods/<slug>.mdx (H2 → H3, then straight verbatim), and defers Properties extraction to a preWriteAsyncJob that reads the (now prettier-aligned) <!-- clerk:properties-start/end --> markers and writes properties.mdx.

Commits

  1. refactor(repo): move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer — the first move: reflection walks live in one place, extract-methods reads marker-wrapped output produced by the theme. Byte-identical to the pre-refactor docs.
  2. refactor(repo): text-slice parent H2 aggregator sections into methods sub-docs — the follow-through: parent pages carry the info directly (methods + property tables), extract-methods becomes a pure text-slicer, and the marker-block emission is deleted entirely. Byte-identical for every sub-doc; the only expected output delta is the parent pages themselves, which now show their ## name() / `## `name H2 sections in full.
  3. refactor(repo): consolidate custom-theme code-wrap and drop dead structural guards — audit follow-up on custom-theme.mjs: extract one wrapInlineTypeAsCode helper across the 5 partials that used to open-code the strip-backticks / single-wrap dance; delete the four structural type-check helpers plus coerceUnionTypeIfNeeded after confirming a single typedoc copy under pnpm makes instanceof reliable; simplify the OAuth-strategy collapse helpers. 3622 → 3464 lines. Byte-identical output.
  4. refactor(repo): data-drive custom-plugin catch-all type-link replacements — the ~45 pattern/replace entries in getCatchAllReplacements() collapse into a CATCH_ALL_TYPE_LINKS data table of [name, url] (plus a third field for the rare cases where the display name differs from the match, e.g. LoadedClerkClerk), with the regex derived from name. Five genuine one-offs stay inline (SessionResource[] array-suffix regex, Appearance<Theme>, (CreateOrganizationParams) in-page anchor, **Deprecated** full-stop, and the **Default** / **Example** / **Examples** prose rewrites). Adding a new type link is now one row. 692 → 572 lines. Byte-identical output.
  5. refactor(repo): replace FILES_WITHOUT_HEADINGS with @noHeading modifier tag — the long-standing TODO on .typedoc/custom-plugin.mjs's 33-filename allowlist finally lands. Types embedded via <Typedoc /> inside hand-written docs now opt into heading suppression at the source with /** @noHeading */; the theme's MarkdownPageEvent.END listener strips the first heading (any level H1-H6) via output.contents.replace(/^#{1,6} .+\n+/m, '') when the reflection carries the modifier. 31 declarations tagged (verified by empty-array-then-diff experiment — 3 filenames in the original list were dead). Also tagged PaginatedHookConfig because typedoc's comment inheritance for interface HookParams extends PaginatedHookConfig<…> clobbers the child's modifier tags with the parent's — the parent is @inline so it doesn't emit its own page. Byte-identical output.
  6. refactor(repo): remove dead accessor partial from custom-theme — the accessor partial in ClerkMarkdownThemeContext was never invoked: typedoc-plugin-markdown would dispatch to it from its default member partial for accessor-kind reflections, but the theme's custom member returns '' for accessors and short-circuits that path (accessors render as a compact "Property" table in memberWithGroups instead). −11 lines, byte-identical output.
  7. refactor(repo): inline swap() helper into signature partial — three-line array-index swap used exactly once by the signature partial to reorder @displayFunctionSignature output. Inlined as destructuring so the transformation is legible without a jump-away. −15 lines net, byte-identical output.
  8. refactor(repo): remove dead @paramExtension handler and tag registrationgrep -rln "@paramExtension" packages/*/src returned zero hits; the tag was registered in CUSTOM_BLOCK_TAGS but never used on any source declaration, making the ~25-line handler branch in the signature partial unreachable. Removed the handler, dropped the tag from CUSTOM_BLOCK_TAGS, and simplified the sibling @displayFunctionSignature path that shared the same split/join scaffolding. −32 lines net, byte-identical output.
  9. refactor(repo): import escapeChars from markdown-helpers instead of duplicatingescapeChars was defined twice with byte-identical bodies (once exported from .typedoc/markdown-helpers.mjs, once as a local in .typedoc/custom-theme.mjs). Import the shared version. −17 lines net, byte-identical output.

Refs

  • DOCS-11892

Checklist

  • pnpm test runs as expected. (.typedoc vitest: 16/16 pass)
  • pnpm build runs as expected.
  • (If applicable) JSDoc comments have been added or updated for any package exports
  • (If applicable) Documentation has been updated

Type of change

  • 🐛 Bug fix
  • 🌟 New feature
  • 🔨 Breaking change
  • 📖 Refactoring / dependency upgrade / documentation
  • other:

Summary by CodeRabbit

  • New Features

    • Added an isFetching flag to StatementQueryResult.
  • Documentation

    • Refreshed and simplified many generated parameter/property descriptions for consistency and readability.
    • Improved documentation rendering for major APIs (including auth, billing, organizations, sessions, telemetry, and user resources).
    • Enhanced docs post-processing for link replacements and extracted “methods/properties/returns/parameters” sections.
  • Tests

    • Updated documentation snapshots to match the newly rendered output.

…e extract-methods to a marker slicer

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0ab4672

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jul 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Jul 8, 2026 12:32am
swingset Ready Ready Preview, Comment Jul 8, 2026 12:32am

Request Review

@coderabbitai

coderabbitai Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 07982d00-cb28-405f-9954-a69949cb9e4b

📥 Commits

Reviewing files that changed from the base of the PR and between 7c19f9f and 0ab4672.

📒 Files selected for processing (3)
  • packages/shared/src/react/hooks/usePaymentAttemptQuery.types.ts
  • packages/shared/src/react/hooks/usePlanDetailsQuery.types.ts
  • packages/shared/src/react/hooks/useStatementQuery.types.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/shared/src/react/hooks/usePlanDetailsQuery.types.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/shared/src/react/hooks/useStatementQuery.types.ts
  • packages/shared/src/react/hooks/usePaymentAttemptQuery.types.ts

📝 Walkthrough

Walkthrough

This PR updates the TypeDoc pipeline to slice rendered markdown into extracted method pages, adds @noHeading support through config and theme changes, and regenerates snapshots. It also rewords JSDoc comments across backend, frontend, shared React, and shared type files, with one shared query result type gaining isFetching.

Changes

TypeDoc pipeline rework

Layer / File(s) Summary
Config and tag handling
typedoc.config.mjs
Adds @noHeading to typedoc processing and removes @paramExtension from custom block tags.
Plugin link replacement
.typedoc/custom-plugin.mjs
Consolidates catch-all link rewriting, removes properties stripping, and simplifies the page END handler.
Theme type handling
.typedoc/custom-theme.mjs
Switches type checks to runtime instanceof logic and updates inline wrapping, OAuthStrategy handling, and declaration rendering.
Theme method extraction helpers
.typedoc/custom-theme.mjs
Adds helpers for synthesized method sections, properties wrapping, and extracted-methods page reshaping.
Markdown-slicing method extraction
.typedoc/extract-methods.mjs
Rewrites extraction around rendered markdown H2 sections and deferred properties processing.
Returns and parameters extraction
.typedoc/extract-returns-and-params.mjs
Adds package configuration and normalizes nominal parameter headings before extraction.
Generated TypeDoc snapshots
.typedoc/__tests__/__snapshots__/*
Regenerated snapshots reflect the updated pipeline output and doc wording.

Documentation comment updates

Layer / File(s) Summary
Backend API and token docs
packages/backend/src/api/endpoints/*, packages/backend/src/api/resources/OrganizationMembership.ts, packages/backend/src/tokens/*, packages/backend/src/webhooks.ts
Backend JSDoc is reformatted or reworded, with @noHeading and @inline markers updated.
Next.js, React, and Expo docs
packages/nextjs/src/server/createGetAuth.ts, packages/react/src/hooks/useAuth.ts, packages/expo/src/local-credentials/.../useLocalCredentials.ts
Frontend-facing JSDoc is condensed and marker formatting is updated.
Shared React hooks and billing docs
packages/shared/src/react/**
Shared React comments are rewritten, @noHeading/@internal markers are added, and StatementQueryResult gains isFetching.
Shared type docs
packages/shared/src/types/*
Shared type comments are reworded and annotated with @noHeading/@inline markers across multiple resource and hook types.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

  • clerk/javascript#7115: Overlaps in backend/shared TypeDoc-facing JSDoc changes on the same API resource files.
  • clerk/javascript#8853: Also changes the TypeDoc generation pipeline, including the custom plugin, theme, and extraction scripts.

Suggested reviewers: SarahSoutoul, jacekradko

Poem

A rabbit nibbled docs by moonlit light,
Then sliced the pages clean and bright.
“Whether,” not “Indicates,” now hops along,
And headings fade where they don’t belong.
🐇 The docs now bounce in tidy rows.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main refactor: moving Typedoc reflection work into custom-theme and simplifying extract-methods.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@pkg-pr-new

pkg-pr-new Bot commented Jul 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@clerk/astro

npm i https://pkg.pr.new/@clerk/astro@9073

@clerk/backend

npm i https://pkg.pr.new/@clerk/backend@9073

@clerk/chrome-extension

npm i https://pkg.pr.new/@clerk/chrome-extension@9073

@clerk/clerk-js

npm i https://pkg.pr.new/@clerk/clerk-js@9073

@clerk/electron

npm i https://pkg.pr.new/@clerk/electron@9073

@clerk/electron-passkeys

npm i https://pkg.pr.new/@clerk/electron-passkeys@9073

@clerk/eslint-plugin

npm i https://pkg.pr.new/@clerk/eslint-plugin@9073

@clerk/expo

npm i https://pkg.pr.new/@clerk/expo@9073

@clerk/expo-passkeys

npm i https://pkg.pr.new/@clerk/expo-passkeys@9073

@clerk/express

npm i https://pkg.pr.new/@clerk/express@9073

@clerk/fastify

npm i https://pkg.pr.new/@clerk/fastify@9073

@clerk/hono

npm i https://pkg.pr.new/@clerk/hono@9073

@clerk/localizations

npm i https://pkg.pr.new/@clerk/localizations@9073

@clerk/nextjs

npm i https://pkg.pr.new/@clerk/nextjs@9073

@clerk/nuxt

npm i https://pkg.pr.new/@clerk/nuxt@9073

@clerk/react

npm i https://pkg.pr.new/@clerk/react@9073

@clerk/react-router

npm i https://pkg.pr.new/@clerk/react-router@9073

@clerk/shared

npm i https://pkg.pr.new/@clerk/shared@9073

@clerk/tanstack-react-start

npm i https://pkg.pr.new/@clerk/tanstack-react-start@9073

@clerk/testing

npm i https://pkg.pr.new/@clerk/testing@9073

@clerk/ui

npm i https://pkg.pr.new/@clerk/ui@9073

@clerk/upgrade

npm i https://pkg.pr.new/@clerk/upgrade@9073

@clerk/vue

npm i https://pkg.pr.new/@clerk/vue@9073

commit: 0ab4672

… sub-docs

Extend custom-theme.mjs so every reference-object and backend-api parent page
carries all method info in a canonical `## `name()`` / `## `name`` H2 shape:

- renderAggregatorMethodSection synthesizes sections for callable members typedoc
  doesn't emit naturally (function-typed interface properties, extraMethodInterfaces,
  @extractMethods namespace callables emitted with qualified names).
- insertSignatureBlocksIntoNaturalMethodSections injects a ```typescript block
  after each backend-class method's description so natural and synthesized sections
  share one shape.
- removeMethodH2Section strips typedoc's per-overload `### Call Signature`
  sub-headings and lets the aggregator re-emit a single section for the primary
  signature.
- renderAggregatorPropertyTableSection emits `## `name`` H2s for @extractMethods
  namespaces (listing non-callable members) and their non-callable object-shape
  members (expanding the object shape).

Reduce extract-methods.mjs to a pure text-slicer over those sections. Zero
reflection access downstream. findMethodH2Sections detects both `## `name()``
and `## `name`` shapes; reshape helpers demote to H3 and reflow into the
per-method / per-property-table sub-doc shape (byte-identical to what the
previous marker-block builders produced).

Delete the marker-block emission entirely: renderInlineMethodsBlock,
buildMethodMdx, extractCallableMembersFromDeclaration,
processExtractMethodsNamespace, buildPropertyTableDocMdx,
buildExtractMethodsNamespacePropertyTableMdx, and orphaned
appendSignatureOnlyReturns removed from custom-theme.mjs; parseMethodMarkers,
stripMethodsBlock, and both marker-block fallback paths removed from
extract-methods.mjs. The `<!-- clerk:properties-start/end -->` markers stay —
properties.mdx extraction still uses them post-prettier for column alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexisintech alexisintech changed the title refactor(repo): move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer refactor(repo): unify typedoc pipeline around parent H2 aggregator sections Jul 2, 2026
…ctural guards

Audit-driven cleanups of `.typedoc/custom-theme.mjs` (3622 → 3464 lines). Every
edit was regenerated and `diff -rq`-verified against the pre-refactor baseline —
byte-identical output.

- Extract `wrapInlineTypeAsCode()`. Replaces the strip-backticks / strip-code-tags /
  conditional single-wrap block that was copy-pasted across `declarationType`,
  `unionType`, `functionType`, `arrayType`, and `reflectionType`. `functionType`'s
  split-map-join around the delimiter was decorative — global `String.replace`
  produces identical output on the whole string.

- Delete duplicate-typedoc structural guards. `isIntersectionTypeDoc` /
  `isReferenceTypeDoc` / `isReflectionTypeDoc` / `isUnionTypeDoc` /
  `coerceUnionTypeIfNeeded` existed to work around `instanceof` failing when
  multiple TypeDoc copies were loaded into the tree. `find node_modules -name
  typedoc` confirms a single copy under the current pnpm layout, so plain
  `instanceof` works reliably. Simplifies `someType`, `declaration`,
  `collectPropertyReflectionsFromIntersectionArm`, and
  `isArrayElementReferenceInliningToUnion`.

- Simplify OAuth-strategy collapse helpers. Drop the `typeof
  project.getReflectionsByKind === 'function'` runtime guard (stable in TypeDoc
  0.28) and the useless `findNamedTypeDeclaration` fallback in
  `findOAuthStrategyDeclaration` (both real `OAuthStrategy` declarations —
  `packages/shared` and `packages/backend` — are TypeAliases). Inline the
  `sourcePath` local. Convert `flattenUnionTypeMembersForOAuthCollapse` to
  `instanceof UnionType`. The collapse itself stays — TypeScript flattens
  `` `oauth_${OAuthProvider}` `` eagerly, so there is no `ReferenceType` for the
  theme to preserve.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ents

Bulk of the ~45 `pattern`/`replace` entries in `getCatchAllReplacements()` were
the same shape: bare identifier not already inside a link/code/anchor →
`[Name](/docs/…)`. Move those into a `CATCH_ALL_TYPE_LINKS` data table of
`[name, url]` (or `[name, url, linkText]` when the display name differs from the
match, as with `LoadedClerk` → `Clerk`), derive the regex from the name via a
small `catchAllBareSymbolRegex` helper, and keep the five genuine one-offs
inline (`SessionResource[]` array-suffix regex, `Appearance<Theme>`,
`(CreateOrganizationParams)` in-page anchor, `**Deprecated**` full-stop, and the
`**Default**` / `**Example**` / `**Examples**` prose rewrites).

Also splits the previous `(SignIn|SignUp)Errors` regex into two data-table
entries so every link rule is a simple identifier + url pair — makes adds
trivial.

`custom-plugin.mjs`: 692 → 572 lines. Byte-identical output vs baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…er tag

Types that clerk-docs embeds via `<Typedoc />` inside hand-written pages need
typedoc-plugin-markdown's `## Properties` group heading suppressed so the
embedded fragment doesn't collide with the parent page's heading hierarchy.
Previously this was a hardcoded array of 33 filenames + a post-hoc regex strip
in `custom-plugin.mjs` — long-standing TODO to move the trigger to the source
declaration.

- New `@noHeading` modifier tag registered in `typedoc.config.mjs` (both
  `modifierTags` and `notRenderedTags`; also added to the theme's hidden-tag
  set in the `comment` partial so it doesn't render as a `**No Heading**`
  badge — typedoc-plugin-markdown ignores `notRenderedTags` for modifier tags).
- `custom-theme.mjs` `MarkdownPageEvent.END` listener strips the first heading
  (any level H1-H6) via `output.contents.replace(/^#{1,6} .+\n+/m, '')` when
  `decl.comment.hasModifier('@noHeading')`.
- Added `/** @noHeading */` to the 31 source declarations that emit today's
  live entries (verified by empty-array-then-diff experiment; 3 filenames in
  the original list were dead — no typedoc-emitted file matched them). Also
  added `@noHeading` to `PaginatedHookConfig` because typedoc's comment
  inheritance for `interface HookParams extends PaginatedHookConfig<…>`
  replaces `HookParams`'s modifier tags with the parent's — tagging the
  parent gets it inherited (parent is `@inline` so it has no page of its own).
- Deleted `FILES_WITHOUT_HEADINGS` and its strip from `custom-plugin.mjs`.

`custom-plugin.mjs`: 573 → 514 lines. Byte-identical output vs baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The `accessor` partial in `ClerkMarkdownThemeContext` is never invoked.
typedoc-plugin-markdown would dispatch to `partials.accessor` from its default
`member` partial for accessor-kind reflections, but the theme's custom `member`
partial returns `''` for accessors and short-circuits that path — accessor
rendering happens in `memberWithGroups` (as a compact "Property" table)
instead. The header comment already hedged this ("Fallback single-row
rendering if used directly elsewhere"); nothing does.

Verified byte-identical output vs baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The `swap()` function was a three-line array-index swap used exactly once by
the `signature` partial to reorder the `@displayFunctionSignature` output.
Inline as destructuring so the transformation is legible without a jump-away.

Verified byte-identical output vs baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`grep -rln "@paramExtension" packages/*/src` returns zero hits — the tag is
never used on any source declaration. The custom handler in the `signature`
partial (which would insert extra content after the Parameters section) was
therefore unreachable. Removes the handler branch plus the tag registration
in `CUSTOM_BLOCK_TAGS`. The `@displayFunctionSignature` swap logic that
shared the same split/join scaffolding is simplified to a direct return path.

Verified byte-identical output vs baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…uplicating

`escapeChars` was defined twice — once in `.typedoc/markdown-helpers.mjs`
(exported) and once as a local function in `.typedoc/custom-theme.mjs`, with
byte-identical bodies. Import the shared version and delete the local copy.

Verified byte-identical output vs baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexisintech alexisintech changed the title refactor(repo): unify typedoc pipeline around parent H2 aggregator sections refactor(repo): move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer Jul 7, 2026
@alexisintech alexisintech changed the title refactor(repo): move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer refactor(repo): Move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer Jul 8, 2026
Merged `main` into `aa/docs-11892` (see prior merge commit). Two of the three
regenerated snapshots are cosmetic-only — column-width padding shifted after
merged source updates changed the widest row in each table. The third
(`clerk.mdx`) also captures two new fields on `ClerkAuthenticateWithWeb3Params`
(`protectCheckUrl?`, `signUpProtectCheckUrl?`) added on main.

All 16 `.typedoc/__tests__/` tests pass locally when run from `.typedoc/`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@alexisintech alexisintech changed the title refactor(repo): Move typedoc reflection work into custom-theme, reduce extract-methods to a marker slicer refactor(repo): Move typedoc reflection work into custom-theme, reduce extract-methods Jul 8, 2026
@alexisintech alexisintech marked this pull request as ready for review July 8, 2026 00:12
@alexisintech alexisintech requested a review from manovotny July 8, 2026 00:13
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

API Changes Report

Generated by Break Check on 2026-07-08T00:34:09.130Z

Summary

Metric Count
Packages analyzed 19
Packages with changes 1
🔴 Breaking changes 0
🟡 Non-breaking changes 18
🟢 Additions 0

🤖 This report was reviewed by claude-sonnet-4-6.


@clerk/shared

Current version: 4.25.0
Recommended bump: MINOR → 4.26.0

Subpath ./react

🟡 Non-breaking Changes (7)

Modified: PaymentElementProviderProps
  type PaymentElementProviderProps = {
-   checkout?: CheckoutFlowResource | BillingCheckoutResource | ReturnType<typeof useCheckout>['checkout'];
-   stripeAppearance?: internalStripeAppearance;
-   for?: ForPayerType;
+   checkout?: CheckoutFlowResource | BillingCheckoutResource | ReturnType<typeof useCheckout>['checkout']; /** An object to customize the appearance of the Stripe Payment Element. This allows you to match the form's styling to your application's theme. */
+   stripeAppearance?: internalStripeAppearance; /** Specifies whether to fetch for the current user or Organization. Defaults to `'user'`. */
+   for?: ForPayerType; /** A description to display to the user within the payment element UI. */
    paymentDescription?: string;
  };

Static analyzer: Breaking change in type alias PaymentElementProviderProps: Type changed: {checkout?:import("@clerk/shared").~CheckoutFlowResource|import("@clerk/shared").~BillingCheckoutResource|!ReturnType:t…{checkout?:import("@clerk/shared").~CheckoutFlowResource|import("@clerk/shared").~BillingCheckoutResource|!ReturnType:t…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of JSDoc comments on the fields; the structural shape of PaymentElementProviderProps is identical.

Modified: UseOAuthConsentParams
  type UseOAuthConsentParams = Pick<GetOAuthConsentInfoParams, 'oauthClientId' | 'scope' | 'redirectUri'> & {
-   keepPreviousData?: boolean;
+   keepPreviousData?: boolean; /** Whether a request will be triggered when the hook is mounted and the user is signed in. Defaults to `true`. */
    enabled?: boolean;
  };

Static analyzer: Breaking change in type alias UseOAuthConsentParams: Type changed: !Pick:type<import("@clerk/shared").~GetOAuthConsentInfoParams,'oauthClientId'|'redirectUri'|'scope'>&{keepPreviousData?…!Pick:type<import("@clerk/shared").~GetOAuthConsentInfoParams,'oauthClientId'|'redirectUri'|'scope'>&{keepPreviousData?…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of a JSDoc comment on the enabled field; the structural shape of UseOAuthConsentParams is identical.

Modified: UseOAuthConsentReturn
  type UseOAuthConsentReturn = {
-   data: OAuthConsentInfo | undefined;
-   error: ClerkAPIResponseError | null;
-   isLoading: boolean;
+   data: OAuthConsentInfo | undefined; /** Any error that occurred during the data fetch, or `null` if no error occurred. */
+   error: ClerkAPIResponseError | null; /** Whether the initial consent metadata fetch is still in progress. */
+   isLoading: boolean; /** Whether any request is still in flight, including background updates. */
    isFetching: boolean;
  };

Static analyzer: Breaking change in type alias UseOAuthConsentReturn: Type changed: {data:import("@clerk/shared").~OAuthConsentInfo|undefined;error:import("@clerk/shared").~ClerkAPIResponseError|null;isL…{data:import("@clerk/shared").~OAuthConsentInfo|undefined;/** Any error that occurred during the data fetch,or null i…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of JSDoc comments on the fields; the structural shape of UseOAuthConsentReturn is identical.

Modified: UseOrganizationCreationDefaultsParams
  type UseOrganizationCreationDefaultsParams = {
-   keepPreviousData?: boolean;
+   keepPreviousData?: boolean; /** Whether a request will be triggered when the hook is mounted. Defaults to `true`. */
    enabled?: boolean;
  };

Static analyzer: Breaking change in type alias UseOrganizationCreationDefaultsParams: Type changed: {keepPreviousData?:boolean;enabled?:boolean;}{keepPreviousData?:boolean;/** Whether a request will be triggered when the hook is mounted. Defaults to true. */ ena…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of a JSDoc comment on the enabled field; the structural shape of UseOrganizationCreationDefaultsParams is identical.

Modified: UseOrganizationCreationDefaultsReturn
  type UseOrganizationCreationDefaultsReturn = {
-   data: OrganizationCreationDefaultsResource | undefined | null;
-   error: ClerkAPIResponseError | null;
-   isLoading: boolean;
+   data: OrganizationCreationDefaultsResource | undefined | null; /** Any error that occurred during the data fetch, or `null` if no error occurred. */
+   error: ClerkAPIResponseError | null; /** Whether the initial data is still being fetched. */
+   isLoading: boolean; /** Whether any request is still in flight, including background updates. */
    isFetching: boolean;
  };

Static analyzer: Breaking change in type alias UseOrganizationCreationDefaultsReturn: Type changed: {data:import("@clerk/shared").~OrganizationCreationDefaultsResource|null|undefined;error:import("@clerk/shared").~Clerk…{data:import("@clerk/shared").~OrganizationCreationDefaultsResource|null|undefined;/** Any error that occurred during t…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of JSDoc comments on the fields; the structural shape of UseOrganizationCreationDefaultsReturn is identical.

Modified: UsePaymentElementReturn
// ... 8 unchanged lines elided ...
      data: null;
      error: PaymentElementError;
    }>;
-   reset: () => Promise<void>;
+   reset: () => Promise<void>; /** Whether the payment form UI has been rendered and is ready for user input. This is useful for disabling a submit button until the form is interactive. */
    isFormReady: boolean;
  } & ({
    provider: {
      name: 'stripe';
-   };
+   }; /** Whether the underlying payment provider (e.g. Stripe) has been fully initialized. */
    isProviderReady: true;
  } | {
    provider: undefined;
// ... 2 unchanged lines elided ...

Static analyzer: Breaking change in type alias UsePaymentElementReturn: Type changed: ({provider:undefined;isProviderReady:false;}|{provider:{name:'stripe';};isProviderReady:true;})&{submit:()=>!Promise:in…({provider:undefined;isProviderReady:false;}|{provider:{name:'stripe';};/** Whether the underlying payment provider(e.g…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of JSDoc comments on the fields; the structural shape of UsePaymentElementReturn is identical.

Modified: UseSubscriptionParams
  type UseSubscriptionParams = {
-   for?: ForPayerType;
-   keepPreviousData?: boolean;
+   for?: ForPayerType; /** Whether the previous data will be kept in the cache until new data is fetched. Defaults to `false`. */
+   keepPreviousData?: boolean; /** Whether a request will be triggered when the hook is mounted. Defaults to `true`. */
    enabled?: boolean;
  };

Static analyzer: Breaking change in type alias UseSubscriptionParams: Type changed: {for?:import("@clerk/shared").~ForPayerType;keepPreviousData?:boolean;enabled?:boolean;}{for?:import("@clerk/shared").~ForPayerType;/** Whether the previous data will be kept in the cache until new data is f…

🤖 AI review (reclassified as non-breaking) (98%): The only difference between before and after is the addition of JSDoc comments on the fields; the structural shape of UseSubscriptionParams is identical.

Subpath ./types

🟡 Non-breaking Changes (11)

Click to expand 11 changes
Modified: CheckoutErrors
  type CheckoutErrors = {
-   raw: unknown[] | null;
+   raw: unknown[] | null; /** Parsed errors that are not related to any specific field. Does not include any errors that could be parsed as a field error */
    global: ClerkGlobalHookError[] | null;
  };

Static analyzer: Breaking change in type alias CheckoutErrors: Type changed: {raw:null|unknown[];global:import("@clerk/shared").~ClerkGlobalHookError[]|null;}{raw:null|unknown[];/** Parsed errors that are not related to any specific field. Does not include any errors that coul…

🤖 AI review (reclassified as non-breaking) (99%): The only difference between the before and after snippets is the addition of a JSDoc comment on the raw field; the structural shape of CheckoutErrors is identical.

Modified: CreateAPIKeyParams
  type CreateAPIKeyParams = {
-   name: string;
-   subject?: string;
-   secondsUntilExpiration?: number;
+   name: string; /** The user or organization ID to associate the API key with. If not provided, defaults to the [Active Organization](!active-organization), then the current user. */
+   subject?: string; /** The number of seconds until the API key expires. Set to `null` or omit to create a key that never expires. */
+   secondsUntilExpiration?: number; /** The description of the API key. */
    description?: string;
  };

Static analyzer: Breaking change in type alias CreateAPIKeyParams: Type changed: {name:string;subject?:string;secondsUntilExpiration?:number;description?:string;}{name:string;/** The user or organization ID to associate the API key with. If not provided,defaults to the[Active Orga…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of JSDoc comments on existing fields of CreateAPIKeyParams.

Modified: GetAPIKeysParams
  type GetAPIKeysParams = ClerkPaginationParams<{
-   subject?: string;
+   subject?: string; /** A search query to filter API keys by name. */
    query?: string;
  }>;

Static analyzer: Breaking change in type alias GetAPIKeysParams: Type changed: import("@clerk/shared").ClerkPaginationParams<{subject?:string;query?:string;}>import("@clerk/shared").ClerkPaginationParams<{subject?:string;/** A search query to filter API keys by name. */ query?…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of a JSDoc comment on the query field of GetAPIKeysParams.

Modified: RevokeAPIKeyParams
  type RevokeAPIKeyParams = {
-   apiKeyID: string;
+   apiKeyID: string; /** The reason for revoking the API key. */
    revocationReason?: string;
  };

Static analyzer: Breaking change in type alias RevokeAPIKeyParams: Type changed: {apiKeyID:string;revocationReason?:string;}{apiKeyID:string;/** The reason for revoking the API key. */ revocationReason?:string;}

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of a JSDoc comment on the revocationReason field of RevokeAPIKeyParams.

Modified: SDKMetadata
  type SDKMetadata = {
-   name: string;
-   version: string;
+   name: string; /** The npm package version of the SDK. */
+   version: string; /** Typically this will be the `NODE_ENV` that the SDK is currently running in. */
    environment?: string;
  };

Static analyzer: Breaking change in type alias SDKMetadata: Type changed: {name:string;version:string;environment?:string;}{name:string;/** The npm package version of the SDK. */ version:string;/** Typically this will be the NODE_ENV that t…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of JSDoc comments on existing fields of SDKMetadata.

Modified: SignInFutureResource.emailCode
  emailCode: {
      sendCode: (params?: SignInFutureEmailCodeSendParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies a code sent with the [`emailCode.sendCode()`](https://clerk.com/docs/reference/objects/sign-in-future#email-code-send-code) method. */
      verifyCode: (params: SignInFutureEmailCodeVerifyParams) => Promise<{
        error: ClerkError | null;
      }>;
// ... 1 unchanged line elided ...

Static analyzer: Breaking change in property SignInFutureResource.emailCode: Type changed: {sendCode:(params?:import("@clerk/shared").SignInFutureEmailCodeSendParams)=>!Promise:interface<{error:import("@clerk/s…{sendCode:(params?:import("@clerk/shared").SignInFutureEmailCodeSendParams)=>!Promise:interface<{error:import("@clerk/s…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of a JSDoc comment before verifyCode in SignInFutureResource.emailCode.

Modified: SignInFutureResource.emailLink
  emailLink: {
      sendLink: (params: SignInFutureEmailLinkSendParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Waits for email link verification to complete or expire. */
      waitForVerification: () => Promise<{
        error: ClerkError | null;
      }>;
      verification: {
-       status: 'verified' | 'expired' | 'failed' | 'client_mismatch';
-       createdSessionId: string;
+       status: 'verified' | 'expired' | 'failed' | 'client_mismatch'; /** The ID of the session that was created upon completion of the current sign-in. */
+       createdSessionId: string; /** Whether the verification was from the same client. */
        verifiedFromTheSameClient: boolean;
      } | null;
    };

Static analyzer: Breaking change in property SignInFutureResource.emailLink: Type changed: {sendLink:(params:import("@clerk/shared").SignInFutureEmailLinkSendParams)=>!Promise:interface<{error:import("@clerk/sh…{sendLink:(params:import("@clerk/shared").SignInFutureEmailLinkSendParams)=>!Promise:interface<{error:import("@clerk/sh…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of JSDoc comments on existing fields in SignInFutureResource.emailLink.

Modified: SignInFutureResource.mfa
  mfa: {
      sendPhoneCode: () => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies a phone code sent with the [`mfa.sendPhoneCode()`](https://clerk.com/docs/reference/objects/sign-in-future#mfa-send-phone-code) method. */
      verifyPhoneCode: (params: SignInFutureMFAPhoneCodeVerifyParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Sends an email code to sign in with as a second factor. */
      sendEmailCode: () => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies an email code sent with the [`mfa.sendEmailCode()`](https://clerk.com/docs/reference/objects/sign-in-future#mfa-send-email-code) method. */
      verifyEmailCode: (params: SignInFutureMFAEmailCodeVerifyParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies an authenticator app (TOTP) code to sign in with as a second factor. */
      verifyTOTP: (params: SignInFutureTOTPVerifyParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies a backup code to sign in with as a second factor. */
      verifyBackupCode: (params: SignInFutureBackupCodeVerifyParams) => Promise<{
        error: ClerkError | null;
      }>;
// ... 1 unchanged line elided ...

Static analyzer: Breaking change in property SignInFutureResource.mfa: Type changed: {sendPhoneCode:()=>!Promise:interface<{error:import("@clerk/shared").~ClerkError|null;}>;verifyPhoneCode:(params:import…{sendPhoneCode:()=>!Promise:interface<{error:import("@clerk/shared").~ClerkError|null;}>;/** Verifies a phone code sent…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of JSDoc comments on existing methods in SignInFutureResource.mfa.

Modified: SignInFutureResource.phoneCode
  phoneCode: {
      sendCode: (params?: SignInFuturePhoneCodeSendParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies a code sent with the [`phoneCode.sendCode()`](https://clerk.com/docs/reference/objects/sign-in-future#phone-code-send-code) method. */
      verifyCode: (params: SignInFuturePhoneCodeVerifyParams) => Promise<{
        error: ClerkError | null;
      }>;
// ... 1 unchanged line elided ...

Static analyzer: Breaking change in property SignInFutureResource.phoneCode: Type changed: {sendCode:(params?:import("@clerk/shared").SignInFuturePhoneCodeSendParams)=>!Promise:interface<{error:import("@clerk/s…{sendCode:(params?:import("@clerk/shared").SignInFuturePhoneCodeSendParams)=>!Promise:interface<{error:import("@clerk/s…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of a JSDoc comment before verifyCode in SignInFutureResource.phoneCode.

Modified: SignInFutureResource.resetPasswordEmailCode
  resetPasswordEmailCode: {
      sendCode: () => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies a password reset code sent with the [`resetPasswordEmailCode.sendCode()`](https://clerk.com/docs/reference/objects/sign-in-future#reset-password-email-code-send-code) method. Will cause `signIn.status` to become `'needs_new_password'`. This is when you will call the [`resetPasswordEmailCode.submitPassword()`](https://clerk.com/docs/reference/objects/sign-in-future#reset-password-email-code-submit-password) method to complete the password reset flow. */
      verifyCode: (params: SignInFutureEmailCodeVerifyParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Submits a new password and moves the sign-in status to `'complete'`. */
      submitPassword: (params: SignInFutureResetPasswordSubmitParams) => Promise<{
        error: ClerkError | null;
      }>;
// ... 1 unchanged line elided ...

Static analyzer: Breaking change in property SignInFutureResource.resetPasswordEmailCode: Type changed: {sendCode:()=>!Promise:interface<{error:import("@clerk/shared").~ClerkError|null;}>;verifyCode:(params:import("@clerk/s…{sendCode:()=>!Promise:interface<{error:import("@clerk/shared").~ClerkError|null;}>;/** Verifies a password reset code…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of JSDoc comments on existing methods in SignInFutureResource.resetPasswordEmailCode.

Modified: SignInFutureResource.resetPasswordPhoneCode
  resetPasswordPhoneCode: {
      sendCode: (params?: SignInFutureResetPasswordPhoneCodeSendParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Verifies a password reset code sent with the [`resetPasswordPhoneCode.sendCode()`](https://clerk.com/docs/reference/objects/sign-in-future#reset-password-phone-code-send-code) method. Will cause `signIn.status` to become `'needs_new_password'`. This is when you will call the [`resetPasswordPhoneCode.submitPassword()`](https://clerk.com/docs/reference/objects/sign-in-future#reset-password-phone-code-submit-password) method to complete the password reset flow. */
      verifyCode: (params: SignInFutureResetPasswordPhoneCodeVerifyParams) => Promise<{
        error: ClerkError | null;
-     }>;
+     }>; /** Submits a new password and moves the sign-in status to `'complete'`. */
      submitPassword: (params: SignInFutureResetPasswordSubmitParams) => Promise<{
        error: ClerkError | null;
      }>;
// ... 1 unchanged line elided ...

Static analyzer: Breaking change in property SignInFutureResource.resetPasswordPhoneCode: Type changed: {sendCode:(params?:import("@clerk/shared").SignInFutureResetPasswordPhoneCodeSendParams)=>!Promise:interface<{error:imp…{sendCode:(params?:import("@clerk/shared").SignInFutureResetPasswordPhoneCodeSendParams)=>!Promise:interface<{error:imp…

🤖 AI review (reclassified as non-breaking) (99%): The before and after snippets are structurally identical; the only change is the addition of JSDoc comments on existing methods in SignInFutureResource.resetPasswordPhoneCode.


Report generated by Break Check

Last ran on 0ab4672.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🧹 Nitpick comments (1)
.typedoc/extract-methods.mjs (1)

216-216: 🚀 Performance & Scalability | 🔵 Trivial | 💤 Low value

Minor: simplify the trailing-separator trim regex.

/^(\s|\*+\s*)*$/ uses nested quantifiers over overlapping alternatives (both branches can match whitespace), a shape prone to backtracking. Input here is short trailing lines so it's not a practical risk, but an equivalent, backtracking-free form is clearer:

♻️ Optional simplification
-    while (sectionLines.length && /^(\s|\*+\s*)*$/.test(sectionLines[sectionLines.length - 1])) sectionLines.pop();
+    while (sectionLines.length && /^[\s*]*$/.test(sectionLines[sectionLines.length - 1])) sectionLines.pop();
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.typedoc/extract-methods.mjs at line 216, The trailing-separator trim check
in extract-methods.mjs uses an overly complex regex with overlapping whitespace
branches, so simplify the condition in the sectionLines pop loop to an
equivalent, clearer pattern that matches blank or asterisk-prefixed separator
lines without nested backtracking. Update the regex used in the while statement
in the section trimming logic only, keeping the same behavior while making the
intent easier to read and maintain.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/shared/src/react/hooks/usePaymentAttemptQuery.types.ts`:
- Around line 17-25: The JSDoc for PaymentAttemptQueryResult.error is out of
sync with the exported type, since the property is ClerkAPIResponseError | null
rather than undefined. Update the comment in usePaymentAttemptQuery.types so the
error description matches the actual union type and states null is the empty
value; keep the rest of PaymentAttemptQueryResult aligned with the documented
loading and data fields.

In `@packages/shared/src/react/hooks/usePlanDetailsQuery.types.ts`:
- Around line 16-24: The JSDoc on PlanDetailsQueryResult.error is inconsistent
with its type, since the property is ClerkAPIResponseError | null but the
comment says undefined. Update the error documentation in
usePlanDetailsQuery.types so it matches the actual union and reflects null as
the no-error state, keeping the wording aligned with the other fields in
PlanDetailsQueryResult.

In `@packages/shared/src/react/hooks/useStatementQuery.types.ts`:
- Around line 17-25: The JSDoc for the `error` field in
`useStatementQuery.types` is out of sync with the hook behavior. Update the
comment in `UseStatementQueryResult` so it documents `null` as the no-error
value, matching `useStatementQuery.tsx` and its `query.error ?? null` return,
and keep the rest of the type definition unchanged.

In `@packages/shared/src/types/signInFuture.ts`:
- Around line 16-17: The `strategy` field in `SignInFuture` is described too
narrowly as a “first factor verification strategy,” which can misrepresent the
exported API for the `OAuthStrategy`, `enterprise_sso`, `PasskeyStrategy`, and
`TicketStrategy` union. Update the JSDoc on `strategy` in `SignInFuture` to use
a neutral “authentication strategy” description that still explains it depends
on `identifier` and that supported strategies vary by authentication identifier.

---

Nitpick comments:
In @.typedoc/extract-methods.mjs:
- Line 216: The trailing-separator trim check in extract-methods.mjs uses an
overly complex regex with overlapping whitespace branches, so simplify the
condition in the sectionLines pop loop to an equivalent, clearer pattern that
matches blank or asterisk-prefixed separator lines without nested backtracking.
Update the regex used in the while statement in the section trimming logic only,
keeping the same behavior while making the intent easier to read and maintain.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Repository UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d84060d4-3f13-4703-9c52-3f524306f892

📥 Commits

Reviewing files that changed from the base of the PR and between 0a29667 and 7c19f9f.

📒 Files selected for processing (52)
  • .changeset/typedoc-marker-slicer.md
  • .typedoc/__tests__/__snapshots__/api-key-resource-methods-create.mdx
  • .typedoc/__tests__/__snapshots__/clerk-properties.mdx
  • .typedoc/__tests__/__snapshots__/clerk.mdx
  • .typedoc/__tests__/__snapshots__/user-resource-properties.mdx
  • .typedoc/custom-plugin.mjs
  • .typedoc/custom-theme.mjs
  • .typedoc/extract-methods.mjs
  • .typedoc/extract-returns-and-params.mjs
  • packages/backend/src/api/endpoints/BillingApi.ts
  • packages/backend/src/api/endpoints/EnterpriseConnectionApi.ts
  • packages/backend/src/api/endpoints/OrganizationApi.ts
  • packages/backend/src/api/endpoints/UserApi.ts
  • packages/backend/src/api/resources/OrganizationMembership.ts
  • packages/backend/src/tokens/types.ts
  • packages/backend/src/tokens/verify.ts
  • packages/backend/src/webhooks.ts
  • packages/expo/src/local-credentials/useLocalCredentials/useLocalCredentials.ts
  • packages/nextjs/src/server/createGetAuth.ts
  • packages/react/src/hooks/useAuth.ts
  • packages/shared/src/react/billing/payment-element.tsx
  • packages/shared/src/react/contexts.tsx
  • packages/shared/src/react/hooks/createBillingPaginatedHook.tsx
  • packages/shared/src/react/hooks/useAPIKeys.tsx
  • packages/shared/src/react/hooks/useOAuthConsent.types.ts
  • packages/shared/src/react/hooks/useOrganization.tsx
  • packages/shared/src/react/hooks/useOrganizationCreationDefaults.types.ts
  • packages/shared/src/react/hooks/useOrganizationList.tsx
  • packages/shared/src/react/hooks/usePaymentAttemptQuery.types.ts
  • packages/shared/src/react/hooks/usePaymentAttempts.tsx
  • packages/shared/src/react/hooks/usePaymentMethods.tsx
  • packages/shared/src/react/hooks/usePlanDetailsQuery.types.ts
  • packages/shared/src/react/hooks/usePlans.tsx
  • packages/shared/src/react/hooks/useReverification.ts
  • packages/shared/src/react/hooks/useStatementQuery.types.ts
  • packages/shared/src/react/hooks/useStatements.tsx
  • packages/shared/src/react/hooks/useSubscription.types.ts
  • packages/shared/src/react/types.ts
  • packages/shared/src/types/apiKeys.ts
  • packages/shared/src/types/billing.ts
  • packages/shared/src/types/clerk.ts
  • packages/shared/src/types/client.ts
  • packages/shared/src/types/factors.ts
  • packages/shared/src/types/hooks.ts
  • packages/shared/src/types/multiDomain.ts
  • packages/shared/src/types/organizationDomain.ts
  • packages/shared/src/types/session.ts
  • packages/shared/src/types/signInFuture.ts
  • packages/shared/src/types/signUpFuture.ts
  • packages/shared/src/types/telemetry.ts
  • packages/shared/src/types/user.ts
  • typedoc.config.mjs

Comment thread packages/shared/src/react/hooks/usePaymentAttemptQuery.types.ts
Comment thread packages/shared/src/react/hooks/usePlanDetailsQuery.types.ts
Comment thread packages/shared/src/react/hooks/useStatementQuery.types.ts
Comment on lines +16 to 17
/** The first factor verification strategy to use in the sign-in flow. Depends on the `identifier` value. Each authentication identifier supports different verification strategies. */
strategy?: OAuthStrategy | 'enterprise_sso' | PasskeyStrategy | TicketStrategy;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Broaden the strategy description.

PasskeyStrategy and TicketStrategy are part of this union, so “first factor verification strategy” is too narrow for the exported API and can mislead generated docs. Consider a neutral “authentication strategy” description instead.

♻️ Proposed fix
-  /** The first factor verification strategy to use in the sign-in flow. Depends on the `identifier` value. Each authentication identifier supports different verification strategies. */
+  /** The authentication strategy to use in the sign-in flow. */
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
/** The first factor verification strategy to use in the sign-in flow. Depends on the `identifier` value. Each authentication identifier supports different verification strategies. */
strategy?: OAuthStrategy | 'enterprise_sso' | PasskeyStrategy | TicketStrategy;
/** The authentication strategy to use in the sign-in flow. */
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/shared/src/types/signInFuture.ts` around lines 16 - 17, The
`strategy` field in `SignInFuture` is described too narrowly as a “first factor
verification strategy,” which can misrepresent the exported API for the
`OAuthStrategy`, `enterprise_sso`, `PasskeyStrategy`, and `TicketStrategy`
union. Update the JSDoc on `strategy` in `SignInFuture` to use a neutral
“authentication strategy” description that still explains it depends on
`identifier` and that supported strategies vary by authentication identifier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant